const mutations = {
  setPlayingState(state:any, playing:boolean) {
    state.playing = playing
  },
  setSequenceList(state:any, list:Array<any>) {
    state.sequenceList = list
  },
  setPlaylist(state:any, list:Array<any>) {
    state.playlist = list
  },
  setPlayMode(state:any, mode:number) {
    state.playMode = mode
  },
  setCurrentIndex(state:any, index:number) {
    state.currentIndex = index
  },
  setFullScreen(state:any, fullScreen:boolean) {
    state.fullScreen = fullScreen
  },
  setFavoriteList(state:any, list:any) {
    state.favoriteList = list
  },
  addSongLyric(state:any, { song, lyric }:any) {
    state.sequenceList.map((item:any) => {
      if (item.mid === song.mid) {
        item.lyric = lyric
      }
      return item
    })
  },
  setSearchHistory(state:any, searches:any) {
    state.searchHistory = searches
  },
  setPlayHistory(state:any, songs:any) {
    state.playHistory = songs
  }
}

export default mutations
